<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户列表页</title>
</head>
<body>

    <table>
        <thead>
            <tr>
                <td>编号</td>
                <td>用户名</td>
                <td>年龄</td>
                <td>性别</td>
                <td>地址</td>
                <td>角色身份</td>
                <td>数据创建时间</td>
                <td>操作</td>
            </tr>
        </thead>
        <tr th:each="user,iterStat:${users}">
            <td th:id="${iterStat.count}" id="1" th:text="${iterStat.index}"></td>
            <td th:text="${user.userName}"></td>
            <td th:text="${user.age}"></td>
            <td>
                <span th:if="${user.gender == 'm'}">男</span>
                <span th:if="${user.gender == 'w'}">女</span>
            </td>
            <td th:text="${user.address}"></td>
            <td th:switch="${user.role}">
                <span th:case="teacher">老师</span>
                <span th:case="student">学生</span>
                <span th:case="manager">管理员</span>
            </td>
            <td th:text="${#dates.format(user.createTime,'yyyy年MM月dd日 HH:mm:ss')}"></td>

            <td><a th:href="@{/user/updateUser(id=${user.id})}">修改</a>|
                <a th:href="@{/user/deleteUser(id=${user.id})}">删除</a>
            </td>

        </tr>
    </table>



</body>
</html>